package com.mico.example.springboot.jpa.repository;

import com.mico.example.springboot.jpa.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by micocube
 * ProjectName: springboot-example
 * PackageName: com.mico.example.springboot.jpa.repository
 * User: micocube
 * Email: ldscube@gmail.com
 * CreateTime: 2019/2/25下午1:46
 * ModifyTime: 2019/2/25下午1:46
 * Version: 0.1
 * Description:
 **/
public interface UserRepository extends JpaRepository<User, Integer> {
    User findByUsername(String name);

    @Query("FROM User u where u.username=:name")
    User findUser(@Param("name") String name);

}
